package operation;

import book.List.bookList;
import book.List.book ;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:岁亮亮
 * Date:2024-01-08
 * TIME:19:24
 */
public class checkoperation implements IOoperation {

    @Override
    public void work(bookList bookList) {
        System.out.println("查找图书");
        System.out.println("请输入要查找的书名");
        int endnumber=bookList.getUsesize() ;
        Scanner scanner=new Scanner(System.in);
        String str=scanner.nextLine();
        for (int i = 0; i < endnumber; i++) {
            book book=bookList .getBook(i);
            if(book.getName() .equals(str)){
                System.out.println("找到了如下");
                System.out.println(bookList .getBook(i) );
                return;
            }
        }
        System.out.println("没有找到下次再看");

    }
}
